package chapter04.Example15;


class Animal{
    public void shout(){
        System.out.println("喵喵......");
    }
}
  //Dog类
class Dog extends chapter04.Example15.Animal {
    //重写shout()方法
    public void shout(){
        System.out.println("汪汪......");
    }
    public void eat(){
        System.out.println("吃骨头.......");
    }
}
  //定义测试类
public class Example15 {
    public static void main(String[] args){
       Dog dog =new Dog();
        Animal an = dog;
        an.shout();
    }
}

